/**
 * 商家管理页面处理商品信息
 */

import request from "@/request";

/**
 * 获取当前商家用户的全部商品信息
 * @param formData 以table形式传输至后端的数据
 * @returns {*}
 */
export function getCommodityByPagination(formData) {
    return request({
        url: '/merchant/commodity/definedMerchant/all',
        method: 'post',
        headers: {"Content-Type": "multipart/form-data"},
        data: formData
    })
}

/**
 * 根据商品名称获取当前商家用户的商品信息
 * @param formData 以table形式传输至后端的数据
 * @returns {*}
 */
export function getCommodityByTextCurrentMerchant(formData){
    return request({
        url: '/merchant/commodity/definedMerchant/text',
        method: 'post',
        headers: {"Content-Type": "multipart/form-data"},
        data: formData
    })
}

/**
 * 修改指定商家用户的指定商品信息
 * @param formData 以table形式传输至后端的数据
 * @returns {*}
 */
export function updateMerchantCommodity(formData){
    return request({
        url: '/merchant/commodity/definedMerchant/update',
        method: 'post',
        headers: {"Content-Type": "multipart/form-data"},
        data: formData
    })
}

/**
 * 查询指定商家用户所有待售的商品
 * @param formData 以table形式传输至后端的数据
 * @returns {*}
 */
export function selectCommodityReadyForBeingSold(formData){
    return request({
        url: '/merchant/commodity/definedMerchant/ready',
        method: 'post',
        headers: {"Content-Type": "multipart/form-data"},
        data: formData
    })
}

/**
 * 查询指定商家用户所有已下架的商品
 * @param formData 以table形式传输至后端的数据
 * @returns {*}
 */
export function selectCommodityRemove(formData){
    return request({
        url: '/merchant/commodity/definedMerchant/remove',
        method: 'post',
        headers: {"Content-Type": "multipart/form-data"},
        data: formData
    })
}